<?php
/**
 * @author wyl
 * @date 2015-8-25 11:47:03
 */
Yii::import('application.components.widgets.CFrontMenuProvider');
Yii::import('application.components.widgets.CImageCarousel');
class AuctiondetailController extends Controller{
	public function actionIndex(){
		$dao=new AuctionPool();
		$dao=$dao->searchDetail();
		$this->breadcrumbs = array(
				//$dao->title
		);
		$auctionData = array();
		for($aId = 1;$aId <= 3;$aId ++){
			$auctionData[$aId] = new stdClass();
			$auctionData[$aId]->id = $aId;
			$auctionData[$aId]->title = 'auction'.$aId;
			$auctionData[$aId]->winner = 'wyl';
			$auctionData[$aId]->lasttime = date('H:i:s');
			$auctionData[$aId]->current_price = mt_rand(10000, 20000);
			$auctionData[$aId]->photo =Yii::app()->baseUrl."/images/4.png";
			$auctionData[$aId]->avatar =Yii::app()->baseUrl."/images/avatar.png";
		}
		
		$model = new CArrayDataProvider($auctionData, array(
				'id'=>'report',
				'sort'=>array(
						'attributes'=>array(
								'id',
						),
				),
				'pagination'=>array(
						'pageSize'=>5,
				),
		));

		$this->render('index',array('model'=>$dao,'recommendModel'=>$model));
	}
	
	public function actionTest(){
		$model=new AuctionPool();
		$model->auction_id=$_GET['id'];
		$model=$model->searchDetail();
		var_dump($model->category[0]->title);
	}
}